const addTwoNumbers = function (l1, l2) {
  let len1 = l1.length
  let len2 = l2.length
  let str1 = l1.reverse().join('')
  let str2 = l2.reverse().join('')
  let res = Number(str1) + Number(str2)
  //console.log(res.toString().split('').map(Number).reverse())
  console.log(l1 instanceof Array)

  return res.toString().split('').map(Number).reverse()
}

addTwoNumbers([9,9,9,9,9,9,9], [9,9,9,9])
